<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Text</title>
    <script src="../../js/jquery.1.8.3.min.js"></script>
    <script>
        $(function () {
            $("#btn1").click(function () {
               var div = $("div");
               console.log(div.text())
            });

            $("#btn2").click(function () {
                var div = $("div");
                div.text("今天的天气辣鸡！");
            })
        })
    </script>
</head>
<body>
    <div>
        <p>今天的天气真好！</p>
    </div>
    <button id="btn1">获取Text</button>
    <button id="btn2">设置Text</button>
</body>
</html>